﻿
namespace Dev
{
    public static class ExtensionMethods
    {
        #region ======ILogger======
        /// <summary>
        /// 记录trace日志
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="message"></param>
        public static void Trace( this ILogger logger, string message )
        {
            logger.LogTrace( $"{message}" );
        }
        /// <summary>
        /// 记录debug日志
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="message"></param>
        public static void Debug( this ILogger logger, string message )
        {
            logger.LogDebug( $"{message}" );
        }
        /// <summary>
        /// 记录info日志
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="message"></param>
        public static void Info( this ILogger logger, string message )
        {
            logger.LogInformation( $"{message}" );
        }
        /// <summary>
        /// 记录warning日志
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="message"></param>
        public static void Warning( this ILogger logger, string message )
        {
            logger.LogWarning( $"{message}" );
        }
        /// <summary>
        /// 记录error日志
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="message"></param>
        public static void Error( this ILogger logger, string message )
        {
            logger.LogError( $"{message}" );
        }
        /// <summary>
        /// 记录critical日志
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="message"></param>
        public static void Critical( this ILogger logger, string message )
        {
            logger.LogCritical( $"{message}" );
        }
        #endregion
    }
}
